<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Map对象的应用</title>
</head>
<body>
  <button>text</button>
  <script>
    const newMap = new Map([['clickCount', 0]]);
    document.querySelector('button').onclick = function () {
      const clickCountVal = newMap.get('clickCount');
      // 同名key会进行覆盖
      newMap.set('clickCount', clickCountVal + 1);
      console.log('newMap', newMap);
    }
  </script>
</body>
</html>